package com.upay.android.domain.rest;

import java.io.Serializable;

import org.codehaus.jackson.type.TypeReference;

import com.upay.android.domain.request.RequestEnvelope;
import com.upay.android.domain.request.RequestHeader;
import com.upay.android.domain.response.ResponseEnvelope;

public class RestRequest<H extends RequestHeader, T extends Object, X extends Object> implements Serializable {

	/* ---- Constants ---- */
	private static final long serialVersionUID = 201402172116L;

	
	/* ---- Instance Variables ---- */
	private String url = null;
	private RequestEnvelope<H,T> requestEnvelope;
	private TypeReference<ResponseEnvelope<X>> typeReference = null;
	
		
	/* ---- Constructors ---- */
	
	public RestRequest(String url, RequestEnvelope<H,T> requestEnvelope, TypeReference<ResponseEnvelope<X>> typeReference) {
		this.url = url;
		this.requestEnvelope = requestEnvelope;
		this.typeReference = typeReference;
	}
	
	/* ---- Business Methods ---- */
	
	/* ---- Getters and Setters ---- */
	
	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}
	
	/**
	 * @param url the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}
	
	public RequestEnvelope<H,T> getRequestEnvelope() {
		return requestEnvelope;
	}

	public void setRequestEnvelope(RequestEnvelope<H,T> requestEnvelope) {
		this.requestEnvelope = requestEnvelope;
	}

	/**
	 * @return the typeReference
	 */
	public TypeReference<ResponseEnvelope<X>> getTypeReference() {
		return typeReference;
	}

	/**
	 * @param typeReference the typeReference to set
	 */
	public void setTypeReference(TypeReference<ResponseEnvelope<X>> typeReference) {
		this.typeReference = typeReference;
	}

}
